﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DomainDriver.DomainModeling.TransactionScripts
{
    public abstract class TransactionScriptBase<ARG1, RETURN> : TransactionScriptBase<RETURN>
    {
        private bool m_IsArgument1Set = false;
        private ARG1 m_Argument1 = default(ARG1);

        protected ARG1 Argument1
        {
            get
            {
                if (!m_IsArgument1Set)
                {
                    string message = string.Format("Argument of type '{0}' is not set.", typeof(ARG1).Name);
                    throw new ApplicationException(message);
                }
                return m_Argument1;
            }
            set
            {
                if (m_IsArgument1Set)
                {
                    string message = string.Format("Argument of type '{0}' is already set.", typeof(ARG1).Name);
                    throw new ApplicationException(message);
                }
                m_Argument1 = value;
                m_IsArgument1Set = true;
            }
        }

        public override bool IsReady()
        {
            if (!m_IsArgument1Set)
            { return false; }
            return base.IsReady();
        }
    }

    public abstract class TransactionScriptBase<ARG1, ARG2, RETURN> : TransactionScriptBase<ARG1, RETURN>
    {
        private bool m_IsArgument2Set = false;
        private ARG2 m_Argument2 = default(ARG2);

        protected ARG2 Argument2
        {
            get
            {
                if (!m_IsArgument2Set)
                {
                    string message = string.Format("Argument of type '{0}' is not set.", typeof(ARG2).Name);
                    throw new ApplicationException(message);
                }
                return m_Argument2;
            }
            set
            {
                if (m_IsArgument2Set)
                {
                    string message = string.Format("Argument of type '{0}' is already set.", typeof(ARG2).Name);
                    throw new ApplicationException(message);
                }
                m_Argument2 = value;
                m_IsArgument2Set = true;
            }
        }

        public override bool IsReady()
        {
            if (!m_IsArgument2Set)
            { return false; }
            return base.IsReady();
        }
    }

    public abstract class TransactionScriptBase<ARG1, ARG2, ARG3, RETURN> : TransactionScriptBase<ARG1, ARG2, RETURN>
    {
        private bool m_IsArgument3Set = false;
        private ARG3 m_Argument3 = default(ARG3);

        protected ARG3 Argument3
        {
            get
            {
                if (!m_IsArgument3Set)
                {
                    string message = string.Format("Argument of type '{0}' is not set.", typeof(ARG3).Name);
                    throw new ApplicationException(message);
                }
                return m_Argument3;
            }
            set
            {
                if (m_IsArgument3Set)
                {
                    string message = string.Format("Argument of type '{0}' is already set.", typeof(ARG3).Name);
                    throw new ApplicationException(message);
                }
                m_Argument3 = value;
                m_IsArgument3Set = true;
            }
        }

        public override bool IsReady()
        {
            if (!m_IsArgument3Set)
            { return false; }
            return base.IsReady();
        }
    }

    public abstract class TransactionScriptBase<ARG1, ARG2, ARG3, ARG4, RETURN> : TransactionScriptBase<ARG1, ARG2, ARG3, RETURN>
    {
        private bool m_IsArgument4Set = false;
        private ARG4 m_Argument4 = default(ARG4);

        protected ARG4 Argument4
        {
            get
            {
                if (!m_IsArgument4Set)
                {
                    string message = string.Format("Argument of type '{0}' is not set.", typeof(ARG4).Name);
                    throw new ApplicationException(message);
                }
                return m_Argument4;
            }
            set
            {
                if (m_IsArgument4Set)
                {
                    string message = string.Format("Argument of type '{0}' is already set.", typeof(ARG4).Name);
                    throw new ApplicationException(message);
                }
                m_Argument4 = value;
                m_IsArgument4Set = true;
            }
        }

        public override bool IsReady()
        {
            if (!m_IsArgument4Set)
            { return false; }
            return base.IsReady();
        }
    }

    public abstract class TransactionScriptBase<ARG1, ARG2, ARG3, ARG4, ARG5, RETURN> : TransactionScriptBase<ARG1, ARG2, ARG3, ARG4, RETURN>
    {
        private bool m_IsArgument5Set = false;
        private ARG5 m_Argument5 = default(ARG5);

        protected ARG5 Argument5
        {
            get
            {
                if (!m_IsArgument5Set)
                {
                    string message = string.Format("Argument of type '{0}' is not set.", typeof(ARG5).Name);
                    throw new ApplicationException(message);
                }
                return m_Argument5;
            }
            set
            {
                if (m_IsArgument5Set)
                {
                    string message = string.Format("Argument of type '{0}' is already set.", typeof(ARG5).Name);
                    throw new ApplicationException(message);
                }
                m_Argument5 = value;
                m_IsArgument5Set = true;
            }
        }

        public override bool IsReady()
        {
            if (!m_IsArgument5Set)
            { return false; }
            return base.IsReady();
        }
    }

    public abstract class TransactionScriptBase<ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, RETURN> : TransactionScriptBase<ARG1, ARG2, ARG3, ARG4, ARG5, RETURN>
    {
        private bool m_IsArgument6Set = false;
        private ARG6 m_Argument6 = default(ARG6);

        protected ARG6 Argument6
        {
            get
            {
                if (!m_IsArgument6Set)
                {
                    string message = string.Format("Argument of type '{0}' is not set.", typeof(ARG6).Name);
                    throw new ApplicationException(message);
                }
                return m_Argument6;
            }
            set
            {
                if (m_IsArgument6Set)
                {
                    string message = string.Format("Argument of type '{0}' is already set.", typeof(ARG6).Name);
                    throw new ApplicationException(message);
                }
                m_Argument6 = value;
                m_IsArgument6Set = true;
            }
        }

        public override bool IsReady()
        {
            if (!m_IsArgument6Set)
            { return false; }
            return base.IsReady();
        }
    }

    public abstract class TransactionScriptBase<ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, RETURN> : TransactionScriptBase<ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, RETURN>
    {
        private bool m_IsArgument7Set = false;
        private ARG7 m_Argument7 = default(ARG7);

        protected ARG7 Argument7
        {
            get
            {
                if (!m_IsArgument7Set)
                {
                    string message = string.Format("Argument of type '{0}' is not set.", typeof(ARG7).Name);
                    throw new ApplicationException(message);
                }
                return m_Argument7;
            }
            set
            {
                if (m_IsArgument7Set)
                {
                    string message = string.Format("Argument of type '{0}' is already set.", typeof(ARG7).Name);
                    throw new ApplicationException(message);
                }
                m_Argument7 = value;
                m_IsArgument7Set = true;
            }
        }

        public override bool IsReady()
        {
            if (!m_IsArgument7Set)
            { return false; }
            return base.IsReady();
        }
    }

    public abstract class TransactionScriptBase<ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8, RETURN> : TransactionScriptBase<ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, RETURN>
    {
        private bool m_IsArgument8Set = false;
        private ARG8 m_Argument8 = default(ARG8);

        protected ARG8 Argument8
        {
            get
            {
                if (!m_IsArgument8Set)
                {
                    string message = string.Format("Argument of type '{0}' is not set.", typeof(ARG8).Name);
                    throw new ApplicationException(message);
                }
                return m_Argument8;
            }
            set
            {
                if (m_IsArgument8Set)
                {
                    string message = string.Format("Argument of type '{0}' is already set.", typeof(ARG8).Name);
                    throw new ApplicationException(message);
                }
                m_Argument8 = value;
                m_IsArgument8Set = true;
            }
        }

        public override bool IsReady()
        {
            if (!m_IsArgument8Set)
            { return false; }
            return base.IsReady();
        }
    }

    public abstract class TransactionScriptBase<ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8, ARG9, RETURN> : TransactionScriptBase<ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8, RETURN>
    {
        private bool m_IsArgument9Set = false;
        private ARG9 m_Argument9 = default(ARG9);

        protected ARG9 Argument9
        {
            get
            {
                if (!m_IsArgument9Set)
                {
                    string message = string.Format("Argument of type '{0}' is not set.", typeof(ARG9).Name);
                    throw new ApplicationException(message);
                }
                return m_Argument9;
            }
            set
            {
                if (m_IsArgument9Set)
                {
                    string message = string.Format("Argument of type '{0}' is already set.", typeof(ARG9).Name);
                    throw new ApplicationException(message);
                }
                m_Argument9 = value;
                m_IsArgument9Set = true;
            }
        }

        public override bool IsReady()
        {
            if (!m_IsArgument9Set)
            { return false; }
            return base.IsReady();
        }
    }

    public abstract class TransactionScriptBase<ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8, ARG9, ARG10, RETURN> : TransactionScriptBase<ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8, ARG9, RETURN>
    {
        private bool m_IsArgument10Set = false;
        private ARG10 m_Argument10 = default(ARG10);

        protected ARG10 Argument10
        {
            get
            {
                if (!m_IsArgument10Set)
                {
                    string message = string.Format("Argument of type '{0}' is not set.", typeof(ARG10).Name);
                    throw new ApplicationException(message);
                }
                return m_Argument10;
            }
            set
            {
                if (m_IsArgument10Set)
                {
                    string message = string.Format("Argument of type '{0}' is already set.", typeof(ARG10).Name);
                    throw new ApplicationException(message);
                }
                m_Argument10 = value;
                m_IsArgument10Set = true;
            }
        }

        public override bool IsReady()
        {
            if (!m_IsArgument10Set)
            { return false; }
            return base.IsReady();
        }
    }
}